Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new API function H5Pget_actual_select_io_mode() #2974

Merged
merged 44 commits into from
Oct 20, 2023

Conversation

fortnern
Copy link
Member

@fortnern fortnern commented May 17, 2023

This function allows the user to determine if the library performed selection I/O, vector I/O, or scalar (legacy) I/O during the last HDF5 operation performed with the provided DXPL. Expanded existing tests to check this functionality.

@derobins derobins marked this pull request as draft May 25, 2023 14:24
@derobins derobins added Merge - To 1.14 This needs to be merged to HDF5 1.14 Priority - 1. High 🔼 These are important issues that should be resolved in the next release Component - C Library Core C library issues (usually in the src directory) Type - New Feature Add a new API call, functionality, or tool labels May 25, 2023
@fortnern fortnern marked this pull request as ready for review June 9, 2023 20:40
@derobins derobins added this to the 1.14.3 milestone Oct 19, 2023
src/H5CX.c Outdated Show resolved Hide resolved
src/H5CX.c Outdated Show resolved Hide resolved
HGOTO_ERROR(H5E_VFL, H5E_READERROR, FAIL, "driver read vector request failed");

/* Set actual selection I/O mode, if this is a raw data operation */
if (is_raw) {
Copy link
Collaborator

@jhendersonHDF jhendersonHDF Oct 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the scalar I/O pathway in H5FD_write/H5FD_read is checking that the raw data I/O is size > 0, should we be checking that as well in the vector I/O pathway, or does that matter?

Copy link
Member Author

@fortnern fortnern Oct 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we could do this for vector without too much problem, but to implement it for selection we'd have to check all the dataspaces which could be expensive for the "_id" routines which would have to resolve all of those IDs into H5S_t *s. Vector already avoids modifying the io mode when passed 0 vectors (count == 0),, and that could easily be added to selection. I suppose you could make an argument for reverting this change for scalar (it is making the callback after all), though I'd have to change the test code.

Copy link
Member Author

@fortnern fortnern Oct 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I decided to revert the checking for size == 0. There's a fairly lengthy comment explaining some of this behavior in the test now.

herr_t ret_value = SUCCEED; /* return value */

FUNC_ENTER_API(FAIL)
H5TRACE2("e", "ix", plist_id, actual_selection_io_mode);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be i*Iu for the trace macro? Looks like that's used for both unsigned and uint32_t

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is what bin/trace spits out. It might be an error but it seems to be the same for other similar functions.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems inconsistent based on

hdf5/src/H5D.c

Line 1204 in b916ce2

H5TRACE5("e", "ii*h*Iux", dset_id, dxpl_id, offset, filters, buf);

Copy link
Member Author

@fortnern fortnern Oct 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be getting confused by the "/* out */"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a bug in the bin/trace script that affects many existing API functions. I think the fix is outside the scope of this PR

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Filed issue #3733

src/H5Ppublic.h Outdated Show resolved Hide resolved

/* Exception case: This will turn off selection I/O landing at H5FD__mpio_write() */
if ((test_mode & TEST_TCONV_BUF_TOO_SMALL) && !(test_mode & TEST_IN_PLACE_TCONV))
no_selection_io_cause_write_expected |= H5D_SEL_IO_TCONV_BUF_TOO_SMALL;
else
no_selection_io_cause_write_expected |= H5D_SEL_IO_NO_VECTOR_OR_SELECTION_IO_CB;
// no_selection_io_cause_write_expected |= H5D_SEL_IO_NO_VECTOR_OR_SELECTION_IO_CB;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like commenting out this line will cause the setting of selection I/O below to only occur in the else clause. Is that intended?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reworked this section, I think it's cleaner now

@jhendersonHDF
Copy link
Collaborator

Just some minor comments/possible fixes but otherwise this looks good to me

@fortnern fortnern changed the title Implement H5Pget_actual_select_io_mode() Add new API function H5Pget_actual_select_io_mode() Oct 20, 2023
@derobins derobins merged commit 630d6e2 into HDFGroup:develop Oct 20, 2023
40 checks passed
jhendersonHDF pushed a commit to jhendersonHDF/hdf5 that referenced this pull request Oct 20, 2023
This function allows the user to determine if the library performed selection I/O, vector I/O, or scalar (legacy) I/O during the last HDF5 operation performed with the provided DXPL. Expanded existing tests to check this functionality.
derobins added a commit that referenced this pull request Oct 21, 2023
* Correct ld in format strings in cmpd_dset.c (#3697)

Removes clang warnings

* Clean up comments. (#3695)

* Add NVidia compiler support and CI (#3686)

* Work around Theta system issue failure in links test (#3710)

When the Subfiling VFD is enabled, the links test may
try to initialize the Subfiling VFD and call MPI_Init_thread.
On Theta, this appears to have an issue that will cause
the links test to fail. Reworked the test to check for
the same conditions in a more roundabout way that doesn't
involved initializing the Subfiling VFD

* Fix issue with unmatched messages in ph5diff (#3719)

* provide an alternative to mapfile for older bash (#3717)

* Attempt to quiet some warnings with cray compilers. (#3724)

* Fix CMake VOL passthrough tests by copying files to correct directory (#3721)

* Develop intel split (#3722)

* Split intel compiler flags into sub-folders
* Update Intel options for warnings
* Mostly CMake, Autotools needs additional work

* Fixes and adjustments to t_filters_parallel (#3714)

Broadcast number of datasets to create in multi-dataset I/O cases
so that interference with random number generation doesn't cause
mismatches between ranks

Set fill time for datasets to "never" by default and adjust on a
per-test basis to avoid writing fill values to chunks when it's
unnecessary

Reduce number of loops run in some tests when performing multi-dataset
I/O

Fix an issue in the "fill time never" test where data verification
could fill if file space reuse causes application buffers to be
filled with chosen fill value when reading from datasets with
uninitialized storage

Skip multi-chunk I/O test configurations for multi-dataset I/O
configurations when the TestExpress level is > 1 since those
tests can be more stressful on the file system

Disable use of persistent file free space management for now
since it occasionally runs into an infinite loop in the library's
free space management code

* Suppress cast-qual warning in H5TB Fortran wrapper (#3728)

This interface is fundamentally broken, const-wise.

* Add new API function H5Pget_actual_select_io_mode() (#2974)

This function allows the user to determine if the library performed selection I/O, vector I/O, or scalar (legacy) I/O during the last HDF5 operation performed with the provided DXPL. Expanded existing tests to check this functionality.

* Test scripts now execute in-source with creation of tmp dir (#3723)

Fixes a few issues created in #3580:

* Fixes a problem where committed tools test files were deleted when cleaning after an in-source build
* Fixes issues with test file paths in Autotools tools test scripts

* Add -h and --help as flags in h5cc & h5fc (#3729)

Adds these common help flags in addition to -help

* Update the library version matrix for H5Pset_libver_bounds() (#3702)

* Fixed #3524

Added 1.12, 1.14, and 1.16 to the table for libver bounds in the H5Pset_libver_bounds docs.

* Remove references to LIBVER_V116

---------

Co-authored-by: H. Joe Lee <hyoklee@hdfgroup.org>
Co-authored-by: Allen Byrne <50328838+byrnHDF@users.noreply.github.com>
Co-authored-by: Scot Breitenfeld <brtnfld@hdfgroup.org>
Co-authored-by: Dana Robinson <43805+derobins@users.noreply.github.com>
Co-authored-by: Neil Fortner <fortnern@gmail.com>
Co-authored-by: Glenn Song <43005495+glennsong09@users.noreply.github.com>
Co-authored-by: bmribler <39579120+bmribler@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component - C Library Core C library issues (usually in the src directory) Merge - To 1.14 This needs to be merged to HDF5 1.14 Priority - 1. High 🔼 These are important issues that should be resolved in the next release Type - New Feature Add a new API call, functionality, or tool
Projects
Status: Needs Merged
Development

Successfully merging this pull request may close these issues.

7 participants